package com.spps;

public class PathFactory {
    public static String getPackagePath() {
        try {
            // 获取初始路径
            String path = PathFactory.class.getProtectionDomain().getCodeSource().getLocation().toURI()
                    .getSchemeSpecificPart();
            // 优化路径
            return RegExp.replace("[^/\\\\]*\\.jar", path, "");
        } catch (Exception e) {
        }
        return "";
    }

    public static String getResoureFilePath(String fileName) {
        return PathFactory.class.getClassLoader().getResource(fileName).getPath();
    }
}
